
#include "osnet_reid.h"
#include "osnet_proc.h"

int OsnetREID::init(const std::string& weight_path){
    if (handle) {
        delete handle;
        handle = nullptr;
    }

    OsnetReid *reid_ptr = new OsnetReid(device_id, max_batch_size, dataType, size, use_dynamic, alway_serialize, preprocess);
    reid_ptr->init(weight_path);

    handle = (void *)reid_ptr;

    return 0;
}

std::vector<std::vector<float>> OsnetREID::extract(std::vector<cv::Mat> & img){
    OsnetReid *reid_ptr = (OsnetReid *)handle;
    return reid_ptr->extract(img);
}

OsnetREID::~OsnetREID(){
    OsnetReid *reid_ptr = (OsnetReid *)handle;
    delete reid_ptr;
    handle = nullptr;
}